package test;

import java.util.HashMap;

public class test {
    static final int MAXIMUM_CAPACITY = 1 << 30;

    public static void main(String[] args) {
        HashMap map=new HashMap();

//        System.out.println(tableSizeFor(9));
        System.out.println((1111%16) == (1111&15));
        System.out.println(11);
        System.out.println(1&0);
        System.out.println(0&0);
        System.out.println(0&1);
    }

    static final int tableSizeFor(int cap) {
        int n = cap - 1;
        n |= n >>> 1;
        System.out.println(n);
        n |= n >>> 2;
        System.out.println(n);
        n |= n >>> 4;
        System.out.println(n);
        n |= n >>> 8;
        System.out.println(n);
        n |= n >>> 16;
        System.out.println(n);
        return (n < 0) ? 1 : (n >= MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1;
    }
}
